'use strict';
const moment = require('moment')
const db = uniCloud.database()
exports.main = async (event, context) => {
	console.log(event);
	//event为客户端上传的参数
	let userid = event.userid
	let date = event.date ? event.date : moment().format('yyyy-MM-dd')

	//返回数据给客户端
	return await db.collection('orderRecord').where({
		userid
	}).get()
};